package com.jcl.recruit.crawler.logic;

import com.jcl.recruit.crawler.mapper.CrawlerDownloadTaskMapper;
import com.jcl.recruit.crawler.model.CrawlerDownloadTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * @ClassName CrawlerDownloadTaskLogic
 * @Description TODO
 * @Author yyliu
 * @Date 2018/10/22 14:44
 * @Version 1.0
 **/
@Component
public class CrawlerDownloadTaskLogic implements CrawlerDownloadTaskMapper {

    @Autowired
    private CrawlerDownloadTaskMapper crawlerDownloadTaskMapper;

    public List<CrawlerDownloadTask> findListByDownLoad(String corpCode, String channelType, Integer resumeId) {
        return findList(corpCode, channelType, resumeId, 0);
    }

    public List<CrawlerDownloadTask> findListByResumeId(String corpCode, Integer resumeId) {
        return findList(corpCode, null, resumeId, null);
    }

    @Override
    public List<CrawlerDownloadTask> findList(String corpCode, String channelType, Integer resumeId, Integer status) {
        return crawlerDownloadTaskMapper.findList(corpCode, channelType, resumeId, status);
    }

    @Override
    public int add(CrawlerDownloadTask crawlerDownloadTask) {
        return crawlerDownloadTaskMapper.add(crawlerDownloadTask);
    }

    @Override
    public int updateByResumeIds(List<Integer> resumeIds, Integer status) {
        return crawlerDownloadTaskMapper.update(resumeIds, status);
    }


    @Override
    public int update(List<Integer> ids, Integer status) {
        return crawlerDownloadTaskMapper.update(ids, status);
    }

    @Override
    public int updateTimer(String date, String corpCode, String resumeId) {
        return crawlerDownloadTaskMapper.updateTimer(date, corpCode, resumeId);
    }
}
